<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=7" />
        <title>EPAC - Homepage</title>
        <link rel="shortcut icon" href="<?php echo $this->baseUrl() ?>/images/favicon.ico" type="image/x-icon"/>
        <link href="<?php echo $this->baseUrl() ?>/public/css/style.css" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="<?php echo $this->baseUrl() ?>/public/js/jquery-1.10.0.min.js"></script>
        <!--[if gt IE 6]>
        <link rel="stylesheet" href="<?php echo $this->baseUrl() ?>/public/css/ie.css" type="text/css" media="screen" />
        <![endif]-->
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    </head>

    <body>
        <div class="wrap">
            <div class="center">
                <div class="header">
                    <div class="left">
                        <a href='/'>
                            <img src="<?php echo $this->baseUrl() ?>/public/images/logo.png" width="100">
                        </a>
                        <div class="navigation">
                            <ul>
                                <li>
                                    <?php if ($this->controller == 'index'): ?>
                                        <span> Home </span>
                                    <?php else: ?>
                                        <a href="/"> Home </a>
                                    <?php endif; ?>
                                </li>
                                <?php
                                if (!empty($this->session->user) &&
                                        ($this->session->user->role == Core_Role::ROLE_INPUT ||
                                        $this->session->user->role == Core_Role::ROLE_ADMIN)):
                                    ?>
                                    <li>
                                        <?php if ($this->controller == 'service') : ?>
                                            <span> New Service </span>
                                        <?php else: ?>
                                            <a href="<?php echo $this->baseUrl() ?>/service/new"> New Service </a>
                                        <?php endif; ?>
                                    </li>                                
                                <?php endif; ?>
                                <li>
                                    <?php if ($this->controller == 'about'): ?>
                                        <span> Services </span>
                                    <?php else: ?>
                                        <a href="<?php echo $this->baseUrl() ?>/about"> Services </a>
                                    <?php endif; ?>
                                </li>                                
                                <li>
                                    <?php if ($this->controller == 'tracking'): ?>
                                        <span> Tracking Your Vessel </span>
                                    <?php else: ?>
                                        <a href="<?php echo $this->baseUrl() ?>/tracking"> Tracking Your Vessel </a>
                                    <?php endif; ?>
                                </li>
                                <li class="sub">
                                    <?php if ($this->controller == 'port'): ?>
                                        <span>Ports Info</span>
                                    <?php else: ?>
                                        <a href="<?php echo $this->baseUrl() ?>/port">Ports Info</a>
                                    <?php endif; ?>
                                    <ul class="submenu">
                                        <li>
                                            <a href="<?php echo $this->baseUrl() ?>/port">Main Ports</a>
                                        </li>
                                        <li>
                                            <a href="<?php echo $this->baseUrl() ?>/port/tide">Tide Ports</a>
                                        </li>
                                    </ul>
                                </li>
                                <li class="last">
                                    <?php if ($this->controller == 'contact'): ?>
                                        <span>Contacts</span>
                                    <?php else: ?>
                                        <a href="<?php echo $this->baseUrl() ?>/contact">Contacts</a>
                                    <?php endif; ?>
                                </li>

                            </ul>
                        </div>                          
                    </div>
                    <div align="right" class="right">
                        <div class="login">
                            <?php if (!empty($this->session->user)): ?>
                                <?php $user = $this->session->user ?>
                                <div class="welcome">
                                    Welcome, <span class="user"><?php echo $user->username ?></span>!
                                    <a href="<?php echo $this->baseUrl() ?>/auth/logout">
                                        <img class="logout" src="<?php echo $this->baseUrl() ?>/public/images/logout.png" alt="Log out" title="Sign out">
                                    </a>
                                </div>
                            <?php else: ?>
                                <form action="<?php echo $this->baseUrl() ?>/auth" method="POST" autocomplete="false">
                                    <input type="text" class="username" placeholder="Username" name="username" />
                                    <input type="password" class="password" placeholder="Password" name="password"/>
                                    <input type="submit" class="submit" value="Sign In" style="padding: 4px 15px"/>
                                    <div class="remember">
                                        <input type="checkbox" name='remember_me'/>
                                        <span>Keep me signed in</span>
                                    </div>
                                </form>
                            <?php endif; ?>
                        </div>   
                    </div>
                </div>
                <?php echo $this->layout()->content ?>
            </div>	
        </div>
        <div id="footer-content-wrapper">
            <div id="footer">
                <div id="fbox1">
                    <p>Copyright © <?php echo date('Y') ?> EPAC - All rights reserved.</p>
                </div>
            </div>
        </div>        
        <script>
            var base_url = '<?php echo $this->baseUrl() ?>';
            var date_format = 'd/m/yy';
        </script>        
    </body>
</html>
